home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / nt4.0 server / OEMNSVSN.IN_ / oemnsvsn.inf
INI File  |  1996-07-12  |  25KB  |  607 lines

  1. [Identification]
  2.     OptionType = NetService
  3. [Options]
  4.     SNMP
  5. [FileConstants]
  6. UtilityInf      = "UTILITY.INF"
  7. subroutineinf   = "SUBROUTN.INF"
  8. SoftwareType    = "service"
  9. Exit_Code       = 0
  10. NetEventDLL     = "%SystemRoot%\System32\netevent.dll"
  11. IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"
  12. SNMPEXE         = "%SystemRoot%\System32\snmp.exe"
  13. SNMPTRAPEXE     = "%SystemRoot%\System32\snmptrap.exe"
  14. Manufacturer    = "Microsoft"
  15. ProductMajorVersion     = "4"
  16. ProductMinorVersion     = "0"
  17. ProductVersion  = $(ProductMajorVersion)"."$(ProductMinorVersion)
  18. ProductOpSupport     = 134 
  19. ProductSoftwareName       = "SNMP"
  20. ProductSoftwareTitle      = $(ProductSoftwareName)
  21. ProductSoftwareImagePath  = $(SNMPEXE)
  22. SystemService   = $(!NTN_ServiceBase)
  23. ServiceKeyName  = $(!NTN_ServiceBase)
  24. TCPIPKeyName    = $(!NTN_ServiceBase)"\TCPIP"
  25. ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  26. [GeneralConstants]
  27. from      = ""
  28. to        = ""
  29. ExitCodeOk     = 0
  30. ExitCodeCancel = 1
  31. ExitCodeFatal  = 2
  32. KeyNull         = ""
  33. MAXIMUM_ALLOWED   = 33554432
  34. RegistryErrorIndex = NO_ERROR
  35. KeyProduct      = ""
  36. KeyParameters   = ""
  37. TRUE            = 1
  38. FALSE           = 0
  39. NoTitle            = 0
  40. ExitState   = "Active"
  41. OldVersionExisted = $(FALSE)
  42. DriverPath      = $(!STF_NTPATH)\drivers
  43. [date]
  44.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  45. [Identify]
  46.     read-syms Identification
  47.     set Status     = STATUS_SUCCESSFUL
  48.     set Identifier = $(OptionType)
  49.     set Media      = #("Source Media Descriptions", 1, 1)
  50.     Return $(Status) $(Identifier) $(Media)
  51. [ReturnOptions]
  52.     set Status        = STATUS_FAILED
  53.     set OptionList     = {}
  54.     set OptionTextList = {}
  55.     set LanguageList = ^(LanguagesSupported, 1)
  56.     Ifcontains(i) $($0) in $(LanguageList)
  57.         goto returnoptions
  58.     else
  59.         set Status = STATUS_NOLANGUAGE
  60.         goto finish_ReturnOptions
  61.     endif
  62. returnoptions = +
  63.     set OptionList     = ^(Options, 1)
  64.     set OptionTextList = ^(OptionsText$($0), 1)
  65.     set Status         = STATUS_SUCCESSFUL
  66. finish_ReturnOptions = +
  67.     Return $(Status) $(OptionList) $(OptionTextList)
  68. [InstallOption]
  69.     set Option   = $($1)
  70.     set SrcDir   = $($2)
  71.     set AddCopy  = $($3)
  72.     set DoCopy   = $($4)
  73.     set DoConfig = $($5)
  74.     set LanguageList = ^(LanguagesSupported, 1)
  75.     Ifcontains(i) $($0) NOT-IN $(LanguageList)
  76.         Return STATUS_NOLANGUAGE
  77.     endif
  78.     Debug-Output "OEMNSVSN.INF: STF_CWDIR is: "$(!STF_CWDIR)
  79.     Debug-Output "OEMNSVSN.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  80.     set-subst LF = "\n"
  81.     read-syms GeneralConstants
  82.     read-syms FileConstants
  83.     read-syms DialogConstants$(!STF_LANGUAGE)
  84.     ifstr(i) $(!NTN_Origination) == "NCPA"
  85.         set Continue = $(OK)
  86.     endif
  87.     read-syms FileConstants$(!STF_LANGUAGE)
  88.     detect date
  89.     set-title  $(FunctionTitle)
  90.     set to   = Begin
  91.     set from = Begin
  92.     set CommonStatus = STATUS_SUCCESSFUL
  93.     LoadLibrary "x" $(!STF_CWDDIR)\tcpcfg.dll !TCPCFG_HANDLE
  94.     EndWait
  95. Begin = +
  96.     Ifstr(i) $(!NTN_InstallMode) == deinstall
  97.         set StartLabel = removeadapter
  98.     else-Ifstr(i) $(!NTN_InstallMode) == Update
  99.         set StartLabel = UpgradeSoftware
  100.     else-Ifstr(i) $(!NTN_InstallMode) == bind
  101.         set StartLabel = bindingadapter
  102.     else-Ifstr(i) $(!NTN_InstallMode) == configure
  103.         set StartLabel = configureadapter
  104.     else
  105.         set StartLabel = installadapter
  106.     endif
  107.     set from = $(fatal)
  108.     set to = $(fatal)
  109.     goto $(StartLabel)
  110. installadapter = +
  111.    Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  112.    Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  113.        Goto ShellCodeError
  114.    Else-Ifstr(i) $($R0) == STATUS_FAILED
  115.        Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  116.        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  117.            goto ShellCodeError
  118.        endif
  119.        set Error = $($R0)
  120.        Goto fatal
  121.    Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  122.        Goto successful
  123.    Endif
  124.    Set SrcDir = $($R1)
  125.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  126.     Ifstr $(KeyProduct) != $(KeyNull)
  127.         CloseRegKey $(KeyProduct)
  128.         Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  129.             $(ProductVersion)
  130.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  131.             Debug-Output "ShellCode error: cannot get an error string."
  132.             goto ShellCodeError
  133.         endif
  134.         goto end
  135.     endif
  136.     OpenRegKey $(!REG_H_LOCAL) "" $(TCPIPKeyName) $(MAXIMUM_ALLOWED) TCPIPKey
  137.     Ifstr $(TCPIPKey) == $(KeyNull)
  138.         set RegistryErrorIndex = TCPIP_NONEXIST_ERROR
  139.         goto fatalregistry
  140.     endif
  141.     CloseRegKey $(TCPIPKey)
  142.     StartWait
  143.     ifstr(i) $(OldVersionExisted) == $(FALSE)
  144.         install "Install-Option"
  145.         ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  146.            Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  147.            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  148.                goto ShellCodeError
  149.            endif
  150.            set Error = $($R0)
  151.            goto fatal
  152.         endif
  153.         set OEM_ABANDON_ON = TRUE
  154.         Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  155.             $(ProductSoftwareName), $(ProductSoftwareName),+
  156.             $(ProductSoftwareName), +
  157.             $(STF_CONTEXTINFNAME), $(ProductSoftwareImagePath), "serviceauto", "",+
  158.             {"Tcpip", "EventLog"}, "", $(SNMPEXE)
  159.         Set SoftwareProductKey = $($R1)
  160.         Set SoftwareNetRuleKey = $($R2)
  161.         Set SoftwareServiceKey = $($R3)
  162.         Set SoftwareParameterKey = $($R4)
  163.         Set SoftLinkageKey      = $($R5)
  164.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  165.            Debug-Output "ShellCode error"
  166.            goto ShellCodeError
  167.         endif
  168.         set RegistryErrorIndex = $($R0)
  169.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  170.            EndWait
  171.            Debug-Output "Registry error: add software components"
  172.            CloseRegKey $(SoftwareProductKey)
  173.            CloseRegKey $(SoftwareNetRuleKey)
  174.            CloseRegKey $(SoftwareServiceKey)
  175.            CloseRegKey $(SoftwareParameterKey)
  176.            CloseRegKey $(SoftLinkageKey)
  177.            CloseRegKey $(KeyParameters)
  178.            goto fatalregistry
  179.         endif
  180.         set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  181.                            {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  182.                            {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  183.                            {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  184.                            {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  185.                            {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  186.                            {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}, +
  187.                            {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  188.         Shell $(UtilityInf), AddValueList, $(SoftwareProductKey), $(NewValueList)
  189.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  190.             Debug-Output "ShellCode error."
  191.             goto ShellCodeError
  192.         endif
  193.         set RegistryErrorIndex = $($R0)
  194.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  195.             EndWait
  196.             Debug-Output "Resgitry error: add value list."
  197.             CloseRegKey $(SoftwareProductKey)
  198.             CloseRegKey $(SoftwareNetRuleKey)
  199.             CloseRegKey $(SoftwareServiceKey)
  200.             CloseRegKey $(SoftLinkageKey)
  201.             CloseRegKey $(SoftwareParameterKey)
  202.             goto fatalregistry
  203.         endif
  204.         set NewValueList = {{InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  205.         Shell  $(UtilityInf), AddValueList, $(SoftwareNetRuleKey), $(NewValueList)
  206.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  207.             Debug-Output "ShellCode error."
  208.             goto ShellCodeError
  209.         endif
  210.         set RegistryErrorIndex = $($R0)
  211.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  212.             EndWait
  213.             Debug-Output "Resgitry error: add value list."
  214.             CloseRegKey $(SoftwareProductKey)
  215.             CloseRegKey $(SoftwareNetRuleKey)
  216.             CloseRegKey $(SoftwareServiceKey)
  217.             CloseRegKey $(SoftwareParameterKey)
  218.             CloseRegKey $(SoftLinkageKey)
  219.             goto fatalregistry
  220.         endif
  221.         CreateRegKey $(SoftwareParameterKey) {"EnableAuthenticationTraps",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyTypesSubkey
  222.         Shell $(UtilityInf) AddValueList, $(KeyTypesSubkey), +
  223.             {{"switch", $(NoTitle), $(!REG_VT_DWORD), "1"}}
  224.         CloseRegKey $(KeyTypesSubkey)
  225.         CreateRegKey $(SoftwareParameterKey) {"TrapConfiguration",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyTypesSubkey
  226.         CloseRegKey $(KeyTypesSubkey)
  227.         CreateRegKey $(SoftwareParameterKey) {"PermittedManagers",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyTypesSubkey
  228.         CloseRegKey $(KeyTypesSubkey)
  229.         CreateRegKey $(SoftwareParameterKey) {"ValidCommunities",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyTypesSubkey
  230.         Shell $(UtilityInf) AddValueList, $(KeyTypesSubkey), +
  231.             {{"1", $(NoTitle), $(!REG_VT_SZ), "public"}}
  232.         CloseRegKey $(KeyTypesSubkey)
  233.         CreateRegKey $(SoftwareParameterKey) {"RFC1156Agent",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyTypesSubkey
  234.         Shell $(UtilityInf) AddValueList, $(KeyTypesSubkey), +
  235.             {{"sysContact", $(NoTitle), $(!REG_VT_SZ), ""},+
  236.              {"sysLocation", $(NoTitle), $(!REG_VT_SZ), ""},+
  237.              {"sysServices", $(NoTitle), $(!REG_VT_DWORD), 76}}
  238.         CloseRegKey $(KeyTypesSubkey)
  239.         CreateRegKey $(SoftwareParameterKey) {"ExtensionAgents",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyTypesSubkey
  240.         Shell $(UtilityInf) AddValueList, $(KeyTypesSubkey), +
  241.             {{"1", $(NoTitle), $(!REG_VT_SZ), "SOFTWARE\Microsoft\LANManagerMIB2Agent\CurrentVersion"}, +
  242.              {"2", $(NoTitle), $(!REG_VT_SZ), "SOFTWARE\Microsoft\RFC1156Agent\CurrentVersion"} +
  243.              }
  244.         CloseRegKey $(KeyTypesSubkey)
  245.         CloseRegKey $(SoftwareProductKey)
  246.         CloseRegKey $(SoftwareNetRuleKey)
  247.         CloseRegKey $(SoftwareServiceKey)
  248.         CloseRegKey $(SoftwareParameterKey)
  249.         CloseRegKey $(SoftLinkageKey)
  250.         OpenRegKey $(!REG_H_LOCAL) "" "SOFTWARE\Microsoft" $(MAXIMUM_ALLOWED) MicrosoftKey
  251.         CreateRegKey $(MicrosoftKey) {"RFC1156Agent",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyTypes
  252.         CreateRegKey $(KeyTypes) {"CurrentVersion",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyTypesSubkey
  253.         Shell $(UtilityInf) AddValueList, $(KeyTypesSubkey), +
  254.             {{"Pathname", $(NoTitle), $(!REG_VT_EXPAND_SZ), "%SystemRoot%\System32\inetmib1.dll"}}
  255.         CloseRegKey $(KeyTypesSubkey)
  256.         CloseRegKey $(KeyTypes)
  257.         CreateRegKey $(MicrosoftKey) {"LANManagerMIB2Agent",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyTypes
  258.         CreateRegKey $(KeyTypes) {"CurrentVersion",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyTypesSubkey
  259.         Shell $(UtilityInf) AddValueList, $(KeyTypesSubkey), +
  260.             {{"Pathname", $(NoTitle), $(!REG_VT_EXPAND_SZ), "%SystemRoot%\System32\lmmib2.dll"}}
  261.         CloseRegKey $(KeyTypesSubkey)
  262.         CloseRegKey $(KeyTypes)
  263.         Shell "" InstallMicrosoftAgent "WINS" "WinsMibAgent" "%SystemRoot%\System32\winsmib.dll"
  264.         Shell "" InstallMicrosoftAgent "DHCPServer" "DhcpMibAgent" "%SystemRoot%\System32\dhcpmib.dll"
  265.         Shell "" AddSnmpTrapService
  266.         set RegistryErrorIndex = $($R0)
  267.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  268.             goto fatalregistry
  269.         endif
  270.     endif
  271.     EndWait
  272.     set FLibraryErrCtl = 1
  273.     LibraryProcedure Result, $(!TCPCFG_HANDLE), CPlSnmp, $(!STF_HWND), $(!STF_GUI_UNATTENDED), $(!STF_UNATTENDED), $(!STF_UNATTENDED_SECTION)
  274.     ifint $(Result) == 0
  275.         set CommonStatus = STATUS_REBOOT
  276.     else-ifint $(Result) == 1
  277.         set CommonStatus = STATUS_REBOOT
  278.     else
  279.         set RegistryErrorIndex = $(Result)
  280.         goto fatalregistry
  281.     endif
  282.     Shell $(UtilityInf) SetMasterComponent Microsoft Tcpip $(STF_CONTEXTINFNAME) SNMP
  283.     Goto successful
  284. configureadapter = +
  285.     set FLibraryErrCtl = 1
  286.     LibraryProcedure Result, $(!TCPCFG_HANDLE), CPlSnmp, $(!STF_HWND), "NO", "", ""
  287.     ifint $(Result) == 0
  288.         set CommonStatus = STATUS_NO_EFFECT
  289.     else-ifint $(Result) == 1
  290.         set CommonStatus = STATUS_NO_EFFECT
  291.     else
  292.         set RegistryErrorIndex = $(Result)
  293.         goto fatalregistry
  294.     endif
  295.     goto successful
  296. bindingadapter =+
  297.     set Error = "Binding: Sorry, not yet implemented."
  298.     goto fatal
  299. removeadapter = +
  300.     Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  301.         $(ProductSoftwareName)
  302.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  303.         Debug-Output "ShellCode error"
  304.         goto ShellCodeError
  305.     endif
  306.     set RegistryErrorIndex = $($R0)
  307.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  308.         goto fatalregistry
  309.     endif
  310.     OpenRegKey $(!REG_H_LOCAL) "" "SOFTWARE\Microsoft" $(MAXIMUM_ALLOWED) MicrosoftKey
  311.     DeleteRegTree $(MicrosoftKey) "RFC1156Agent"
  312.     DeleteRegTree $(MicrosoftKey) "LANManagerMIB2Agent"
  313.     CloseRegKey $(MicrosoftKey)
  314.     Shell "" RemoveSnmpTrapService
  315.     set RegistryErrorIndex = $($R0)
  316.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  317.         goto fatalregistry
  318.     endif
  319.     goto end
  320. UpgradeSoftware = +
  321.     Set SNMPKeyName     = "Software\Microsoft\SNMP\CurrentVersion\NetRules"
  322.     Set MaskAllAccess  = 33554432
  323.     Set ValueName = "InfName"
  324.     Set NewInfName = "oemnsvsn.inf"
  325.     OpenRegKey $(!REG_H_LOCAL) "" $(SNMPKeyName) $(MaskAllAccess) SNMPKey
  326.     Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  327.         SetRegValue $(SNMPKey) {$(ValueName),0,$(!REG_VT_SZ),$(NewInfName)}
  328.         CloseRegKey $(SNMPKey)
  329.         Set CacheKey   = "SOFTWARE\Microsoft\Ncpa\InfOptions" 
  330.         Set CacheValue = "oemnxpsn.inf"
  331.         OpenRegKey $(!REG_H_LOCAL) "" $(CacheKey) $(MaskAllAccess) Cache
  332.         Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  333.             DeleteRegTree $(Cache) $(CacheValue)
  334.             CloseRegKey $(Cache)
  335.         endif
  336.     endif
  337.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  338.     Ifstr $(KeyProduct) != $(KeyNull)
  339.         install "Install-Update"
  340.         ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  341.             goto fatal
  342.         endif
  343.         SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  344.         SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  345.         SetRegValue $(KeyProduct) {SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)}
  346.         SetRegValue $(KeyProduct) {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)}
  347.         SetRegValue $(KeyProduct) {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}
  348.         CloseRegKey $(KeyProduct)
  349.         Shell "" AddSnmpTrapService
  350.         set RegistryErrorIndex = $($R0)
  351.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  352.             goto fatalregistry
  353.         endif
  354.     else
  355.         goto fatalregistry
  356.     endif
  357.     goto end
  358. successful = +
  359.     goto end
  360. warning = +
  361.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  362.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  363.         goto ShellCodeError
  364.     endif
  365.     ifstr(i) $($R1) == "OK"
  366.         goto $(to)
  367.     else-ifstr(i) $($R1) == "CANCEL"
  368.         goto $(from)
  369.     else
  370.         goto "end"
  371.     endif
  372. nonfatal = +
  373.     ifstr(i) $(Error) == ""
  374.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  375.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  376.             goto ShellCodeError
  377.         endif
  378.         set Error = $($R0)
  379.     endif
  380.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", $(Error)
  381.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  382.         goto ShellCodeError
  383.     endif
  384.     ifstr(i) $($R1) == "OK"
  385.         goto $(from)
  386.     else
  387.         goto "end"
  388.     endif
  389. fatalregistry = +
  390.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  391.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  392.         goto ShellCodeError
  393.     endif
  394.     set Error = $($R0)
  395.     goto fatal
  396. fatal = +
  397.     ifstr(i) $(Error) == ""
  398.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  399.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  400.             goto ShellCodeError
  401.         endif
  402.         set Error = $($R0)
  403.     endif
  404.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  405.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  406.         goto ShellCodeError
  407.     endif
  408.     goto setfailed
  409. ShellCodeError = +
  410.     set DlgType      = "MessageBox"
  411.     set STF_MB_TITLE = $(ShellCodeErrorTitle)
  412.     set STF_MB_TEXT  = $(ShellCodeErrorText)
  413.     set STF_MB_TYPE  = 1
  414.     set STF_MB_ICON  = 3
  415.     set STF_MB_DEF   = 1
  416.     ui start "Error Message"
  417.     goto setfailed
  418. setfailed = +
  419.     set CommonStatus = STATUS_FAILED
  420.     Ifint $(RegistryErrorIndex) == TCPIP_NONEXIST_ERROR
  421.         set CommonStatus = STATUS_USERCANCEL
  422.     endif
  423.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  424.         set OEM_ABANDON_ON = FALSE
  425.         goto removeadapter
  426.     endif
  427.     goto end
  428. end = +
  429.     freeLibrary $(!TCPCFG_HANDLE)
  430.     goto term
  431. term = +
  432.     Return $(CommonStatus)
  433. [GetFilesSize]
  434.     set FileSizeList = ^(Files-SNMP,3)
  435.     set TotalSize = 0
  436.     ForListDo $(FileSizeList)
  437.         Split-String $($) "=" SplitString
  438.         set Size = *($(SplitString),3)
  439.         set-add TotalSize = $(TotalSize) $(Size)
  440.     EndForListDo
  441.     set-div SizeInK = $(TotalSize) 1024
  442.     return $(SizeInK)
  443. [Install-Option]
  444.     set STF_VITAL = ""
  445.     ifstr(i) $(AddCopy) == "YES"
  446.         AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)
  447.     endif
  448.     ifstr(i) $(DoCopy) == "YES"
  449.        set !STF_NCPA_FLUSH_COPYLIST = TRUE
  450.        CopyFilesInCopyList
  451.     endif
  452.     ifstr(i) $(DoConfig) == "YES"
  453.     endif
  454.     Exit
  455. [Install-Update]
  456.    set STF_VITAL        = ""
  457.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  458.    AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)
  459.    exit
  460. [InstallMicrosoftAgent]
  461.     read-syms GeneralConstants
  462.     read-syms FileConstants
  463.     set AServiceName = $($0)
  464.     set AAgentName   = $($1)
  465.     set APath        = $($2)
  466.     OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Services\SNMP" $(MAXIMUM_ALLOWED) SNMPKey
  467.     ifstr(i) $(SNMPKey) != ""
  468.         CloseRegKey $(SNMPKey)
  469.         OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Services\"$(AServiceName) $(MAXIMUM_ALLOWED) ServiceKey
  470.         ifstr(i) $(ServiceKey) != ""
  471.             CloseRegKey $(ServiceKey)
  472.             OpenRegKey $(!REG_H_LOCAL) "" "SOFTWARE\Microsoft" $(MAXIMUM_ALLOWED) MicrosoftKey
  473.             CreateRegKey $(MicrosoftKey) {$(AAgentName),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyTypes
  474.             CreateRegKey $(KeyTypes) {"CurrentVersion",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyTypesSubkey
  475.             Shell $(UtilityInf) AddValueList, $(KeyTypesSubkey), +
  476.                 {{"Pathname", $(NoTitle), $(!REG_VT_EXPAND_SZ), $(APath)}}
  477.             CloseRegKey $(KeyTypesSubkey)
  478.             CloseRegKey $(KeyTypes)
  479.             CloseRegKey $(MicrosoftKey)
  480.             OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Services\SNMP\Parameters" $(MAXIMUM_ALLOWED) SNMPParmKey
  481.             CreateRegKey $(SNMPParmKey) {$(AAgentName),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyTypesSubkey
  482.             CloseRegKey $(KeyTypesSubkey)
  483.             CloseRegKey $(SNMPParmKey)
  484.             OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Services\SNMP\Parameters\ExtensionAgents" $(MAXIMUM_ALLOWED) KeyTypesSubkey
  485.             EnumRegValue $(KeyTypesSubkey) AgentsList
  486.             set Pos = 1
  487.             ForListDo $(AgentsList)
  488.                 set-add Pos = $(Pos), 1
  489.             EndForListDo
  490.             Shell $(UtilityInf) AddValueList, $(KeyTypesSubkey), +
  491.                 {{$(Pos), $(NoTitle), $(!REG_VT_SZ), "SOFTWARE\Microsoft\"$(AAgentName)"\CurrentVersion"}}
  492.             CloseRegKey $(KeyTypesSubkey)
  493.         endif
  494.     endif
  495.     return
  496. [RemoveMicrosoftAgent]
  497.     read-syms GeneralConstants
  498.     read-syms FileConstants
  499.     set AAgentName   = $($0)
  500.     OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Services\SNMP" $(MAXIMUM_ALLOWED) SNMPKey
  501.     ifstr(i) $(SNMPKey) != ""
  502.         CloseRegKey $(SNMPKey)
  503.         OpenRegKey $(!REG_H_LOCAL) "" "SOFTWARE\Microsoft" $(MAXIMUM_ALLOWED) MicrosoftKey
  504.         DeleteRegTree $(MicrosoftKey) $(AAgentName)
  505.         CloseRegKey $(MicorosoftKey)
  506.         OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Services\SNMP\Parameters" $(MAXIMUM_ALLOWED) SNMPParmKey
  507.         DeleteRegKey $(SNMPParmKey) $(AAgentName)
  508.         OpenRegKey $(SNMPParmKey) "" "ExtensionAgents" $(MAXIMUM_ALLOWED) AgentKey
  509.         EnumRegValue $(AgentKey) AgentsList
  510.         ForListDo $(AgentsList)
  511.             Split-String *($($),4), "\", AgentInfo
  512.             ifContains(i) $(AAgentName) in $(AgentInfo)
  513.                 DeleteRegValue $(AgentKey) *($($),1)
  514.             endif
  515.         EndForListDo
  516.         CloseRegKey $(AgentKey)
  517.         CloseRegKey $(SNMPParmKey)
  518.     endif
  519.     return
  520. [AddSnmpTrapService]
  521.     read-syms GeneralConstants
  522.     read-syms FileConstants
  523.     Set TrapServiceName        = "SNMPTRAP"
  524.     Set TrapServiceDisplayName = "SNMP Trap Service"
  525.     Set TrapServiceImagePath   = $(SNMPTRAPEXE)
  526.     Debug-Output "OEMNSVSN.INF: Before CreateService"
  527.     Shell $(UtilityInf), CreateService, +
  528.         $(TrapServiceName), +
  529.         $(TrapServiceDisplayName), +
  530.         $(TrapServiceImagePath), +
  531.         "service", +
  532.         "",+
  533.         {"Tcpip", "EventLog"}, +
  534.         "", +
  535.         $(SNMPTRAPEXE)
  536.     Debug-Output "OEMNSVSN.INF: After CreateService"
  537.     Debug-Output "OEMNSVSN.INF: R0 from CreateService "$($R0) 
  538.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  539.         Debug-Output "OEMNSVSN.INF: ShellCode error"
  540.         goto ShellCodeError
  541.     endif
  542.     Set RegistryErrorIndex   = $($R0)
  543.     Set SoftwareServiceKey   = $($R1)
  544.     Set SoftwareParameterKey = $($R2)
  545.     Set SoftwareLinkageKey   = $($R3)
  546.     ifstr(i) $(RegistryErrorIndex) == NO_ERROR
  547.         CloseRegKey $(SoftwareServiceKey)
  548.         CloseRegKey $(SoftwareParameterKey)
  549.         CloseRegKey $(SoftwareLinkageKey)
  550.     endif
  551.     Ifstr(i) $(RegistryErrorIndex) == SERVICE_ALREADY_EXISTS
  552.         Set RegistryErrorIndex = NO_ERROR
  553.     Endif
  554.     Return $(RegistryErrorIndex)
  555. [RemoveSnmpTrapService]
  556.     read-syms GeneralConstants
  557.     read-syms FileConstants
  558.     Set TrapServiceName = "SNMPTRAP"
  559.     Shell $(UtilityInf), RemoveService, $(TrapServiceName), "YES"
  560.     Set RegistryErrorIndex = $($R0)
  561.     Return $(RegistryErrorIndex)
  562. [Source Media Descriptions]
  563.     1 = "Windows NT Server CD-ROM", TAGFILE = cdrom_s.40
  564. [Signature]
  565.     FileType = MICROSOFT_FILE
  566. [GetSignature]
  567.     read-syms Signature
  568.     return $(FileType)
  569. [ProductType]
  570. STF_PRODUCT  = LanmanNT
  571. STF_PLATFORM = I386
  572. [Files-Inf]
  573. 2,    oemsetup.inf,     SIZE=1000,    RENAME=$(!UG_Filename)
  574. [Files-SNMP]
  575. 1, MIB.BIN, SIZE=999
  576. 1, SNMP.EXE, SIZE=999
  577. 1, SNMPAPI.DLL, SIZE=999
  578. 1,LMMIB2.DLL , SIZE=999
  579. 1,MGMTAPI.DLL , SIZE=999
  580. 1,SNMPTRAP.EXE , SIZE=999
  581. [LanguagesSupported]
  582.     ENG
  583. [OptionsTextENG]
  584.     SNMP     = "SNMP Service"
  585. [FileConstantsENG]
  586. ProCaption   = "Windows NT Setup"
  587. ProCancel    = "Cancel"
  588. ProCancelMsg = "Windows NT Networking is not correctly installed.  "+
  589.                "Are you sure you want to cancel copying files?"
  590. ProCancelCap = "Network Setup Message"
  591. ProText1     = "Copying:"
  592. ProText2     = "To:"
  593. FunctionTitle   = "SNMP Setup"
  594. ProductSoftwareDescription      = "Simple Network Management Protocol service that enables a Windows NT computer to be administered remotely with an SNMP management tool."
  595. ProductSoftwareDisplayName      = "SNMP Service"
  596. ProductSoftwareTitle    = "SNMP Service"
  597. ShellCodeErrorTitle     = "Error: "$(FunctionTitle)
  598. ShellCodeErrorText      = "Shell Code Error."
  599. [DialogConstantsENG]
  600. Help        = "&Help"
  601. Exit        = "Cancel"
  602. OK          = "OK"
  603. HelpContext = ""
  604. Continue    = "Continue"
  605. Cancel      = "Cancel"
  606. [FileDependentDlgENG]
  607.